public class YangHui{
	public static void main(String[] args) {
		//打印杨辉三角
	 int[][] YangHui = new int[10][];
	 for(int i = 0;i < YangHui.length ;i++ ) {
	 	YangHui[i] = new int[i+1];
	 	for (int j = 0 ;j < YangHui[i].length;j++ ) {
	 		if(j==0 || j==YangHui[i].length-1){//长度写错了！！！！
	 			YangHui[i][j]=1;
	 	}
	 	else{

	 		YangHui[i][j]=YangHui[i-1][j]+YangHui[i-1][j-1];
	 	}
	 }
	 }
	
	//´òÓ¡Ñî»ÔÈý½Ç
	for (int k = 0;k < YangHui.length ;k++ ) {
		for (int l = 0;l < YangHui[k].length  ;l++ ) {
			System.out.print(YangHui[k][l]+" ");
		}
		System.out.println(" ");
	}
}
}